const router = require('koa-router')()
const { User } = require('../../models/index')
router.prefix('/users')



// { name, id, tel, adress, role, IDCard, realName, pwd }
router.post('/delete', async (ctx, next) => {
    let { id } = ctx.request.body
    await User.findOneAndDelete({ id }).then(res => {
        ctx.body = {
            resut: res
        }

    }).catch(err => {
        ctx.body = {
            code: 400,
            msg: '删除时出现异常'
        }
    })
})

module.exports = router